package com.czd.support.enums;

/**
 * 注册枚举类
 * @author Jail Hu
 * @description 
 * @date 2014年4月30日
 */
public enum RegisterTypeEnum {

	手机号码, 邮箱, OAuth;

	/**
	 * 根据枚举值，获取枚举tostring
	 * @param status
	 * @return
	 */
	public static String getStatusStr(int status) {
		try {
			return valueOf(status).toString();
		} catch (Exception e) {
			return "";
		}
	}

	public static RegisterTypeEnum valueOf(int eid) throws Exception {
		for (RegisterTypeEnum s : values()) {
			if (s.ordinal() == eid) {
				return s;
			}
		}
		throw new IllegalArgumentException("No enum const class with your eid");
	}
}
